package com.framewiki.kafka.web;

import com.cdkjframework.core.spring.CdkjApplication;
import com.cdkjframework.kafka.producer.annotation.EnableAutoKafka;
import com.cdkjframework.kafka.producer.util.ProducerUtils;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;

/**
 * @ProjectName: framewiki-kafka
 * @Package: com.framewiki.kafka.web
 * @ClassName: KafkaApplication
 * @Description: kafka 启动类
 * @Author: xiaLin
 * @Date: 2024/3/17 18:04
 * @Version: 1.0
 */
@SpringBootApplication(exclude= {DataSourceAutoConfiguration.class})
@EnableAutoKafka
public class KafkaApplication implements ApplicationRunner {

  /**
   * 启动类
   *
   * @param args 参数
   */
  public static void main(String[] args) {
    CdkjApplication.run(KafkaApplication.class, args);
  }

  /**
   * @param args
   * @throws Exception
   */
  @Override
  public void run(ApplicationArguments args) throws Exception {
    ProducerUtils.sendMessageAsync("test","2132123");
  }
}
